<div  class="box">
<table class="boxlist">
	<thead >
		<tr >
			<th style='width:80px;'>
				Code
			</th>
			<th >
				Name
			</th>
			<th style='width:80px;'>
				Type
			</th>
			<th class='sortable' col='year' style='width:80px;'>
				Borrow
			</th>
			<th class='sortable' col='year' style='width:80px;'>
				Return
			</th>
			
			<th style='width:150px;'>
				Action
			</th>
		</tr>
	</thead>
<?php foreach ($rs as $row): ?>
	<tr >
		<td >
			<?php $code = 'WM'.str_pad($row->reference->id,3,'0',STR_PAD_LEFT) ?>
			<?php
				$label = $code;
				$rurl= array('quickview','id'=>$row->reference->id);
				$htmlOption = array('class'=>'colorbox');
				echo CHtml::link($label,$rurl,$htmlOption);
			?>
		</td>
		<td >
			<?php
				$label = $row->reference->name;
				$rurl= array('quickview','id'=>$row->id);
				$htmlOption = array('class'=>'colorbox');
				echo CHtml::link($label,$rurl,$htmlOption);
			?>
		</td>
		<td >
			<?php echo Yii::app()->params['flag']['referenceType'][$row->reference->reference_type_id] ?>
		</td>
		<td >
			<?php echo date('d M Y',strtotime($row->date_create)); ?>
		</td>
		<td >
			<?php if ($row->date_update): ?>
				<?php echo date('d M Y',strtotime($row->date_update)); ?>
			<?php else: ?>
				[-.-]" ~
			<?php endif ?>
		</td>
		<td >
			<?php if (!$row->date_update): ?>
				<?php
					$label = '<button class="bt3">Return</button>';
					$rurl= array('update','id'=>$row->reference->id);
					$htmlOption = array();
					echo CHtml::link($label,$rurl,$htmlOption);
				?>
			<?php endif ?>
		</td>
	</tr>
<?php endforeach ?>
</table>
<div class='filter silver'>
	
</div>
<div class='tail filter blue'>
	
</div>
</div>
